import React, { Component } from 'react'

export default class App extends Component {
  a = 1000
  changeA = () => {
    this.a = 2000
    this.forceUpdate()
  }
  shouldComponentUpdate (nextProps, nextState) {
    console.log('shouldComponentUpdate')
  }
  componentWillUpdate () {
    console.log('componentWillUpdate')
  }
  componentDidUpdate () {
    console.log('componentDidUpdate')
  }
  render () {
    console.log('render')
    return (
      <div>
        <button onClick={this.changeA}>改变a</button>
        <p>{this.a}</p>
      </div>
    )
  }
}
